﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="NhanVien.aspx.cs" Inherits="EC2011_hk1_BT3_1041074_1041078_1042119.NhanVien" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="right">
		<div class="content">
            <h3>Danh Danh sách Nhân Viên</h3>
            <div class="clear"></div>                
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:PagingDataConnectionString %>" 
                    UpdateCommand="UPDATE [Employees] SET[LastName]=@LastName, [FirstName]=@FirstName, [DepartmentID]=@DepartmentID, [Salary]=@Salary, [HireDate]=@HireDate, [URLPersonalPhoto]=@URLPersonalPhoto, [Description]=@Description WHERE [EmployeeID]=@EmployeeID"
                    DeleteCommand="DELETE FROM [Employees] WHERE [EmployeeID]=@EmployeeID"
                    InsertCommand="INSERT INTO [Employees] VALUES(@LastName, @FirstName, @DepartmentID, @Salary, @HireDate, @URLPersonalPhoto, @Description)"
                    SelectCommand="SELECT [EmployeeID], [LastName], [FirstName], [DepartmentID], [Salary] FROM [Employees] ORDER BY [DepartmentID]">
                </asp:SqlDataSource>
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    BackColor="White" BorderColor="#DEDFDE" 
                    BorderWidth="1px" CellPadding="4" DataKeyNames="EmployeeID" 
                    DataSourceID="SqlDataSource2" ForeColor="Black" GridLines="Vertical" 
                BorderStyle="None">
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:TemplateField ShowHeader="False">
                            <EditItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                                    CommandName="Update" Text="Update"></asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                                    CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                    CommandName="Edit" Text="Edit"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                                    CommandName="Delete" Text="Delete"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#CCCC99" />
                    <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#F7F7DE" ForeColor="Black" 
                        HorizontalAlign="Right" />
                    <RowStyle BackColor="#F7F7DE" />
                    <SelectedRowStyle BackColor="#CE5D5A" ForeColor="White" Font-Bold="True" />
                    <SortedAscendingCellStyle BackColor="#FBFBF2" />
                    <SortedAscendingHeaderStyle BackColor="#848384" />
                    <SortedDescendingCellStyle BackColor="#EAEAD3" />
                    <SortedDescendingHeaderStyle BackColor="#575357" />
                </asp:GridView>
            <h3>Thêm Thêm m&#7899;i Nhân Viên</h3></br>
            <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource2" 
                DefaultMode="Insert" CellPadding="4" ForeColor="#333333">
                <EditItemTemplate>
                    EmployeeID:
                    <asp:Label ID="Label9" runat="server" Text='<%# Eval("EmployeeID") %>'></asp:Label>
                    <br />
                    Last Name:
                    <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("LastName") %>'></asp:TextBox>
                    <br />
                    First Name:
                    <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("FirstName") %>'></asp:TextBox>
                    <br />
                    DepartmentID:
                    <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("DepartmentID") %>'></asp:TextBox>
                    <br />
                    Salary:
                    <asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("Salary") %>'></asp:TextBox>
                    <br />
                    HireDate:
                    <asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("HireDate") %>'></asp:TextBox>
                    <br />
                    URLPersionalPhoto:
                    <asp:TextBox ID="TextBox13" runat="server" 
                        Text='<%# Bind("URLPersonalPhoto") %>'></asp:TextBox>
                    <br />
                    Description:
                    <asp:TextBox ID="TextBox14" runat="server" Text='<%# Bind("Description") %>'></asp:TextBox>

                    <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                        CommandName="Update" Text="Update" />
                    &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                        CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                </EditItemTemplate>
                <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <InsertItemTemplate>
                    Last Name:
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("LastName") %>'></asp:TextBox>
                    <br />
                    First Name:<asp:TextBox ID="TextBox2" runat="server" 
                        Text='<%# Bind("FirstName") %>'></asp:TextBox>
                    <br />
                    DepartmenID:
                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("DepartmentID") %>'></asp:TextBox>
                    <br />
                    Salary:
                    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Salary") %>'></asp:TextBox>
                    <br />
                    HireDate:
                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("HireDate") %>'></asp:TextBox>
                    <br />
                    URLPersonalPhoto:
                    <asp:TextBox ID="TextBox6" runat="server" 
                        Text='<%# Bind("URLPersonalPhoto") %>'></asp:TextBox>
                    <br />
                    Description:
                    <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("Description") %>'></asp:TextBox>

                    <asp:LinkButton Text="Insert" CommandName="Insert" runat="server" 
                        ID="InsertButton" CausesValidation="True"/>
                    &nbsp;<asp:LinkButton Text="Cancel" CommandName="Cancel" runat="server" 
                        ID="InsertCancelButton" CausesValidation="False"/>
                </InsertItemTemplate>
                <ItemTemplate>
                    EmpoyeeID:
                    <asp:Label ID="Label8" runat="server" Text='<%# Eval("EmployeeID") %>'></asp:Label>
                    <br />
                    Last Name:
                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("LastName") %>'></asp:Label><br />
                    First Name:
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("FirstName") %>' ></asp:Label>
                    <br />
                    DepartmentID:
                    <asp:Label ID="Label3" runat="server" Text='<%# Eval("DepartmentID") %>'></asp:Label>
                    <br />
                    Salary:
                    <asp:Label ID="Label4" runat="server" Text='<%# Eval("Salary") %>'></asp:Label>
                    <br />
                    HireDate:
                    <asp:Label ID="Label5" runat="server" Text='<%# Eval("HireDate") %>'></asp:Label>
                    <br />
                    URLPersonalPhoto:
                    <asp:Label ID="Label6" runat="server" Text='<%# Eval("URLPersonalPhoto") %>'></asp:Label>
                    <br />
                    Description:
                    <asp:Label ID="Label7" runat="server" Text='<%# Eval("Description") %>'></asp:Label>
                </ItemTemplate>
                
                
                <PagerStyle BackColor="#FFCC66" ForeColor="#333333" 
                    HorizontalAlign="Center" />
                
                
                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                
                
            </asp:FormView>
        </div>              
    </div>
</asp:Content>
